		include	Common.asm

; ==========================================================
DataSeg		segment para public 'data'
DataSeg		ends

; ==========================================================
CodeSeg		segment para public 'code'

; ----------------------------------------------------------
; IsMouseInstalled
; ----------------------------------------------------------
; Input:	none
; Output:
;	ax	ffffh if mouse is installed, 0000h if not
;	bx	number of buttons
; ----------------------------------------------------------
IsMouseInstalled	proc

	mov	ax, 0000h		; INT 33 - AX = 0000h MS MOUSE - RESET DRIVER AND READ STATUS
	int	33h

	ret

IsMouseInstalled	endp


; ----------------------------------------------------------
; ShowMouseCursor
; ----------------------------------------------------------
; Input:	none
; Output:	none
; ----------------------------------------------------------
ShowMouseCursor	proc

	push	ax

	mov	ax, 0001h		; INT 33 - AX = 0001h MS MOUSE - SHOW MOUSE CURSOR
	int	33h
	
	pop	ax

	ret

ShowMouseCursor	endp


; ----------------------------------------------------------
; HideMouseCursor
; ----------------------------------------------------------
; Input:	none
; Output:	none
; ----------------------------------------------------------
HideMouseCursor	proc

	push	ax

	mov	ax, 0002h		; INT 33 - AX = 0002h MS MOUSE - HIDE MOUSE CURSOR
	int	33h
	
	pop	ax

	ret

HideMouseCursor	endp


; ----------------------------------------------------------
; SetMousePos
; ----------------------------------------------------------
; Input:	none
;	cx	x
;	dx	y
; Output:
; ----------------------------------------------------------
SetMousePos	proc

	push	ax

	mov	ax, 0004h		; INT 33 - AX = 0004h MS MOUSE - POSITION MOUSE CURSOR
	int	33h

	pop	ax

	ret

SetMousePos	endp


; ----------------------------------------------------------
; SetMouseHorzRange
; ----------------------------------------------------------
; Input:	none
;	cx	Min range
;	dx	Max range
; Output:
; ----------------------------------------------------------
SetMouseHorzRange	proc

	push	ax

	mov	ax, 0007h		; INT 33 - AX = 0007h MS MOUSE - DEFINE HORIZONTAL CURSOR RANGE
	int	33h

	pop	ax

	ret

SetMouseHorzRange	endp


; ----------------------------------------------------------
; SetMouseVertRange
; ----------------------------------------------------------
; Input:	none
;	cx	Min range
;	dx	Max range
; Output:
; ----------------------------------------------------------
SetMouseVertRange	proc

	push	ax

	mov	ax, 0008h		; INT 33 - AX = 0008h MS MOUSE - DEFINE VERTICAL CURSOR RANGE
	int	33h

	pop	ax

	ret

SetMouseVertRange	endp


; ----------------------------------------------------------
; GetMouseState
; ----------------------------------------------------------
; Input:	none
; Output:
;	bx	Button Status
;	cx	X Position
;	dx	Y Position
; ----------------------------------------------------------
GetMouseState	proc

	push	ax

	mov	ax, 0003h		; INT 33 - AX = 0003h MS MOUSE - RETURN POSITION AND BUTTON STATUS
	int	33h

	pop	ax

	ret

GetMouseState	endp


; ----------------------------------------------------------
; IsKeyPressed
; ----------------------------------------------------------
; Input:	none
; Output:
;	zf = 0	if there is key input
;	zf = 1	if there is no key input
; ----------------------------------------------------------
IsKeyPressed	proc

	push	ax

	mov	ah, 01h		; INT 16 - AH = 01h KEYBOARD - CHECK BUFFER, DO NOT CLEAR
	int	16h

	pop	ax

	ret

IsKeyPressed	endp


; ----------------------------------------------------------
; GetKey
; ----------------------------------------------------------
; Input:	none
; Output:
;	ah	scan code
;	al	character
; ----------------------------------------------------------
GetKey	proc

	mov	ah, 00h		; INT 16 - AH = 00h KEYBOARD - READ CHAR FROM BUFFER, WAIT IF EMPTY
	int	16h

	ret

GetKey	endp

	
CodeSeg		ends

		end

